<?php

namespace app\common\model;

class ShopGroup extends BaseModel
{
    protected $append = ['info'];
    public function user(){
        return $this->hasMany('ShopGroupUser','group_id');
    }

    public function record(){
        return $this->belongsTo('ShopGroup','group_id');
    }

    public function getInfoAttr($val,$data){
        $arr = ShopGroupUser::where('group_id', $data['id'])->select()->column('uid');
        return $arr;
    }
}
